/*
 * Copyright (c) 2017-2022, Lindenis Tech. Ltd.
 * All rights reserved.
 *
 * File:
 *
 * Description:
 *
 * Author:
 *      xiaoshujun@lindeni.com
 *
 * Create Date:
 *      2022/02/11
 *
 * History:
 *
 */

#ifndef __LINDENI_JPEG_PLYAER__
#define __LINDENI_JPEG_PLYAER__

#ifdef __cplusplus
extern "C" {
#endif

#include "lindcomponent.h"

typedef long hdl_lindjpg_t;

typedef struct
{
    rect_t          disp_pos;
    rotate_degree_e rotate;
} lindjpg_render_cfg_t;

hdl_lindjpg_t lindjpg_create();
void lindjpg_destroy(hdl_lindjpg_t h_jpg);
int  lindjpg_decode (hdl_lindjpg_t h_jpg, const char * jpg_path, av_frame2_t ** p_pic, int max_w, int max_h);
int  lindjpg_render (hdl_lindjpg_t h_jpg, lindjpg_render_cfg_t * p_config, av_frame2_t * p_pic);
int  lindjpg_release(hdl_lindjpg_t h_jpg, av_frame2_t * p_pic);

int  lindjpg_get_mediainfo(const char * jpg_path, int * width, int * height);
int  lindjpg_2_nv21(const char * jpg_path, av_frame2_t * p_nv21, int max_w, int max_h);

#ifdef __cplusplus
}
#endif

#endif	// __LINDENI_JPEG_PLYAER__

